package com.sxm.yiwei.activitis;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

import com.sxm.yiwei.R;

import java.util.ArrayList;
import java.util.List;

public class SellServiceSelecttypeActivity extends BaseActivity {

    private ListView serviceTypelist;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sell_service_selecttype);

        serviceTypelist = (ListView) findViewById(R.id.service_type);
        List<String> typeList = new ArrayList<>();
        typeList.add("劳务市场");
        typeList.add("家政服务");
        typeList.add("跑腿办事");
        typeList.add("维修保养");
        typeList.add("汽车服务");
        typeList.add("线上服务");
        typeList.add("陪玩导游");
        typeList.add("按摩美容");
        typeList.add("生活服务");
        typeList.add("其他");
        final ArrayAdapter<String> adapter = new ArrayAdapter<String>(SellServiceSelecttypeActivity.this,android.R.layout.simple_list_item_1,typeList);
        serviceTypelist.setAdapter(adapter);
        serviceTypelist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent i = new Intent();
                i.putExtra("item",adapter.getItem(position));
                SellServiceSelecttypeActivity.this.setResult(RESULT_OK,i);
                finish();
            }
        });


    }
}
